﻿namespace Nomo.UnityCoreModule.Waiters
{
    /// <summary>
    /// 二元等待器。
    /// </summary>
    public abstract class BinaryWaiter : Waiter
    {
        private protected readonly Waiter Waiter1;
        private protected readonly Waiter Waiter2;

        private protected BinaryWaiter(Waiter waiter1, Waiter waiter2)
        {
            Waiter1 = waiter1 ?? throw new System.ArgumentNullException(nameof(waiter1));
            Waiter2 = waiter2 ?? throw new System.ArgumentNullException(nameof(waiter2));
        }

        /// <inheritdoc />
        public sealed override bool MoveNext()
        {
            return base.MoveNext();
        }

        /// <inheritdoc />
        public sealed override void Reset()
        {
            base.Reset();
            Waiter1.Reset();
            Waiter2.Reset();
        }
    }
}
